package com.example.administrator.personalmail.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.example.administrator.personalmail.R;
import com.example.administrator.personalmail.api.Contants;
import com.ywp.addresspickerlib.AddressPickerView;

public class SelectAddressActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_address);

        AddressPickerView addressPickerView = findViewById(R.id.apvAddress);
        addressPickerView.setOnAddressPickerSure(new AddressPickerView.OnAddressPickerSureListener() {
            @Override
            public void onSureClick(String address, String provinceCode, String cityCode, String districtCode) {
//                Toast.makeText(SelectAddressActivity.this,address,Toast.LENGTH_SHORT).show();
                Intent intent = new Intent();
                intent.putExtra("address",address);
                setResult(Contants.REQUEST_SUCCESS,intent);
                finish();
            }
        });
    }
}
